package com.arofoxmsn.repository;

import java.util.List;

import org.hibernate.criterion.Restrictions;
import com.arofoxmsn.model.ScopeArea;
import com.arofoxmsn.model.User;

public class ScopeAreaTable extends BaseTable<ScopeArea>{

	@Override
	protected Class getModelClass() {
		return ScopeArea.class;
	}
	
	/**
	 * this method is in charge of retrieve all areas for a given
	 * user. Those areas will be used to get All user those are
	 * in the scope of the owner
	 * @param owner
	 * @return
	 */
	public List<ScopeArea> retriveAllAreas(User owner){
		return retrieveAll(Restrictions.eq("owner", owner));
	}
}
